package com.five.monkey.feign.consumer.client;

import com.five.monkey.feign.consumer.client.fallback.TestFeignClientFallback;
import com.five.monkey.vo.CommonVo;
import com.five.monkey.vo.TestVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 狻猊
 * @date 2021/8/9 下午2:51
 */
@FeignClient(value = "feign-provider", fallback = TestFeignClientFallback.class)
public interface TestFeignClient {

    @GetMapping(value = "/provider/test/get", consumes = "application/json")
    CommonVo<TestVo> testGet(@RequestParam("name") String name, @RequestParam("age") int age, @RequestParam("score") float score);

    @PostMapping(value = "/provider/test/post", consumes = "application/json")
    CommonVo<TestVo> testPost(@RequestBody TestVo testVo);
}
